import { getToken, setToken, deleteToken } from "@/utils/storage";

export default {
  namespaced: true,
  state: {
    token: getToken(),
  },
  mutations: {
    setToken(state, newToken) {
      state.token = newToken;
      setToken(newToken);
    },
    delToken(state) {
      deleteToken();
      state.token = null;
    },
  },
};
